<?php


namespace app\api\controller\v1;


use app\api\model\Category;
use app\api\validate\IDMustBePostivelnt;

class CategoryController{
    //获取全部分类
    public function getAllCategory(){
        $categoryModel = new Category();
        $list = $categoryModel::getCategory();
        return json($list);
    }

    //获取一个分类
    public function getOneCategory($id){
        (new IDMustBePostivelnt())->goCheck();
        $categoryModel = new Category();
        $list = $categoryModel::getOneCategory($id);

        return json($list);
    }


}



